﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ch.Elca.Iiop;
using System.Runtime.Remoting.Channels;

namespace rts_client
{
    class rts_client
    {
        static void Main (string[] args)
        {
            IiopClientChannel chan = new IiopClientChannel ();
            ChannelServices.RegisterChannel (chan, false);

            RTS.ORB.RTSORBObjectIF m_rts_obj =
                (RTS.ORB.RTSORBObjectIF) 
                    Activator.GetObject (
                        typeof (RTS.ORB.RTSORBObjectIF), 
                        "iiop://localhost:8088/RTSORBObjectIF"
                    );

            try
            {
                RTS.ORB.SessionTicket session_ticket = m_rts_obj.Login ("user_name", "password");
                Console.WriteLine ("m_rts_obj.Login(): session_ticket => " + session_ticket.GUID + " : " + session_ticket.TimeoutSec);
            }
            catch (Exception e)
            {
                Console.WriteLine ("m_rts_obj.Login(): exception => " + e.Message);
            }

            Console.WriteLine ("Press any key to terminate...");
            Console.Read ();     
        }
    }
}
